package com.cn.bulu.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.bulu.service.AppUpdateService;
import com.cn.bulu.utils.BuluResult;

@Controller
@RequestMapping("/upload")
public class AppUpdateController {
	// "/upload/getAppUpdate"
	@Resource
	private AppUpdateService appUpdateService;

	// 查询app是否有更新(老版本)
	@RequestMapping("/getAppUpdate")
	@ResponseBody
	public BuluResult selectWorker(HttpServletRequest request) {
		BuluResult buluResult = appUpdateService.getUpdateInfo(request);
		return buluResult;
	}
	
	// 查询app是否有更新(新版本)
	@RequestMapping("/getNewAppUpdate")
	@ResponseBody
	public BuluResult getUpdateInfo(HttpServletRequest request,String id) {
		BuluResult buluResult = appUpdateService.getNewUpdateInfo(request,id);
		return buluResult;
	}
}
